<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">

    $(function() {
        $('#eqedittypeid').combobox({
            url : '${path }/equipmenttype/eqtype',
            panelHeight : 'auto',
            valueField:'id',
            textField:'equipmenttypename',
            value : '${inds.eqtypeid}',
            onChange: function (newValue, oldValue) {
                var url= '${path }/inspectionitem/insitemListById?id='+newValue;
                $('#inspectionedititemid').combobox('reload',url);
            }
        });
        $('#inspectionedititemid').combobox({
            url : '${path }/inspectionitem/insitemList',
            panelHeight : 'auto',
            valueField:'id',
            textField:'name',
            value : '${inds.inspectionitemid}',
        });
        $('#inspectioneditfrequency').combobox({

            value : '${inds.inspectionfrequency}',
        });
        $('#indsEditForm').form({
            url : '${path }/inspectiondetail/update',

            onSubmit : function() {
                progressLoad();

                var isValid = $(this).form('validate');


                if (!isValid) {
                    progressClose();
                }

                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });

    });

</script>

<div class="form_title">TInspectiondetail Information</div>
<form id="indsEditForm" >


    <input type="hidden" name="id" id="editid" value="${inds.id}"/>
    <div class="form_item">
        <label>设备类型:</label>
        <select id="eqedittypeid" name="eqtypeid" placeholder="请选择设备类型" style="width: 140px; height: 29px;" value="${inds.eqtypeid}" ></select>
    </div>
    <div class="form_item">
        <label>巡查项目:</label>

        <select id="inspectionedititemid" name="inspectionitemid" placeholder="项目名称" style="width: 140px; height: 29px;" ></select>
    </div>
    <div class="form_item">
        <label>巡查内容:</label>
        <input type="text" id="inspectioncontentedit" name="inspectioncontent" class="easyui-validatebox" required=true validType='length[0, 255]' value="${inds.inspectioncontent}" />
    </div>
    <div class="form_item">
        <label>巡查依据:</label>
        <input type="text" id="inspectionbasisedit" name="inspectionbasis" class="easyui-validatebox" required=true validType='length[0, 255]' value="${inds.inspectionbasis}" />
    </div>
    <div class="form_item">
        <label>巡查频率:</label>
        <select id="inspectioneditfrequency" name="inspectionfrequency"  style="width: 160px;"  class="easyui-combobox" value="${inds.inspectionfrequency}">
            <option value="0">每日巡检</option>
            <option value="1">每周巡检</option>
            <option value="2">每月巡检</option>
            <option value="3">每季巡检</option>
            <option value="4">每年巡检</option>
        </select>
    </div>
    <div class="form_item">
        <label>备注:</label>
        <input type="text" id="inspectionremarksedit" name="inspectionremarks" class="easyui-validatebox" required=true validType='length[0, 255]' value="${inds.inspectionremarks}" />
    </div>
    <div class="form_item">
        <label>管理位:</label>
        <input type="text" id="bitedit" name="bit" class="easyui-numberbox"  required=true min=0 value="${inds.bit}"/>
    </div>

</form>